<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	<ui:composition template="/design/template.xhtml">
    <ui:define name="body">

      <h:form id="frmUsuario" acceptcharset="ISO-8859-1">
      <h:inputHidden id="codigoUsuario" value="#{usuarioAction.usuario.codigo}"/> 
      <h:inputHidden id="emailUsuario" value="#{usuarioAction.usuario.email}"/> 
      <p:panel id="pnlUsuario" header="Dados usuário">

        <p:spacer height="10" />
        <p:messages id="messages" autoUpdate="true" />

        <h:panelGrid columns="3" cellpadding="4" >

          <h:outputLabel value="Senha:" for="senhaUsuario" />
          <p:spacer width="8" />
          <p:password id="senhaAcesso" value="#{usuarioAction.usuario.senhaAcesso}"
            required="true" feedback="false" size="20"
            requiredMessage="Senha obrigatória!" 
            validatorMessage="Senha inválida!">
            <f:validateLength maximum="8" minimum="6"></f:validateLength>
          </p:password>

          <h:outputLabel value="Nova senha:" for="senhaUsuario" />
          <p:spacer width="8" />
          <p:password id="novaSenhaAcesso" value="#{usuarioAction.novaSenhaAcesso}"
            required="true" feedback="false" size="20"
            requiredMessage="Senha obrigatória!" 
            validatorMessage="Senha inválida!">
            <f:validateLength maximum="8" minimum="6"></f:validateLength>
          </p:password>

          <h:outputLabel value="Confirmação:" for="confirmacaoSenhaUsuario" />
          <p:spacer width="8" />
          <p:password id="confirmacaoSenhaAcesso" value="#{usuarioAction.confirmacaoSenhaAcesso}" 
            required="true" feedback="false" size="20"
            requiredMessage="Confirmação obrigatória!" 
            validatorMessage="Confirmação inválida!">
            <f:validateLength maximum="8" minimum="6"></f:validateLength>
          </p:password>
          

        </h:panelGrid>
        <p:spacer height="10" />
        <p:outputPanel id="pnlButons">
          <div align="left" id="divButons">
            <p:commandButton action="#{usuarioAction.iniciar}" update="pnlUsuario" value="cancelar" ajax="false" immediate="true" />
            <p:spacer width="10" />
            <p:commandButton action="#{usuarioAction.alterarSenha}" update="pnlUsuario" value="confirmar" ajax="false" />
          </div>
        </p:outputPanel>			

    </p:panel>
    </h:form>

  </ui:define>
  </ui:composition>
</html>
